﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Root.master" AutoEventWireup="true" CodeFile="detail.aspx.cs" Inherits="Default2" %>

<%@ Register Assembly="DevExpress.Web.v12.2, Version=12.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" Namespace="DevExpress.Web.ASPxFormLayout" TagPrefix="dx" %>

<%@ Register assembly="DevExpress.Xpo.v12.2.Web, Version=12.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Xpo" tagprefix="dx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Content" Runat="Server">
    <dx:ASPxFormLayout ID="grp_root" runat="server" Width="100%" Height="100%">
        <Items>
            <dx:TabbedLayoutGroup Caption="Tabbed Group" Width="100%">
                <Items>
                    <dx:LayoutGroup Caption="Информация о заявке">
                        <Items>
                            <dx:LayoutGroup Caption="Layout Group" ShowCaption="False">
                                <Border BorderStyle="None" />
                                <Items>
                                    <dx:LayoutItem Caption="Номер заявки:">
                                        <LayoutItemNestedControlCollection>
                                            <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                                                <dx:ASPxLabel ID="lb_RqId" runat="server" Text="">
                                                </dx:ASPxLabel>
                                            </dx:LayoutItemNestedControlContainer>
                                        </LayoutItemNestedControlCollection>
                                    </dx:LayoutItem>
                                    <dx:LayoutItem Caption="Управляющая компания:">
                                        <LayoutItemNestedControlCollection>
                                            <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                                                <dx:ASPxLabel ID="lbl_MgmtCompanyId" runat="server" Text="">
                                                </dx:ASPxLabel>
                                            </dx:LayoutItemNestedControlContainer>
                                        </LayoutItemNestedControlCollection>
                                    </dx:LayoutItem>
                                    <dx:LayoutItem Caption="Домоуправление:">
                                        <LayoutItemNestedControlCollection>
                                            <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                                                <dx:ASPxLabel ID="lbl_DU" runat="server" Text="">
                                                </dx:ASPxLabel>
                                            </dx:LayoutItemNestedControlContainer>
                                        </LayoutItemNestedControlCollection>
                                    </dx:LayoutItem>
                                    <dx:LayoutItem Caption="Номер в журнале ДУ:">
                                        <LayoutItemNestedControlCollection>
                                            <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                                                <dx:ASPxLabel ID="lbl_LocalId" runat="server" Text="">
                                                </dx:ASPxLabel>
                                            </dx:LayoutItemNestedControlContainer>
                                        </LayoutItemNestedControlCollection>
                                    </dx:LayoutItem>
                                    <dx:LayoutItem Caption="Статус:">
                                        <LayoutItemNestedControlCollection>
                                            <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                                                <dx:ASPxLabel ID="lbl_State" runat="server" Text="">
                                                </dx:ASPxLabel>
                                            </dx:LayoutItemNestedControlContainer>
                                        </LayoutItemNestedControlCollection>
                                    </dx:LayoutItem>
                                    <dx:LayoutItem Caption="Адрес:">
                                        <LayoutItemNestedControlCollection>
                                            <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                                                <dx:ASPxLabel ID="lbl_Addr" runat="server" Text="">
                                                </dx:ASPxLabel>
                                            </dx:LayoutItemNestedControlContainer>
                                        </LayoutItemNestedControlCollection>
                                    </dx:LayoutItem>
                                </Items>
                            </dx:LayoutGroup>
                            <dx:LayoutGroup Caption="Layout Group" ColCount="2" ShowCaption="False">
                                <Items>
                                    <dx:LayoutItem Caption="Внес пользователь:">
                                        <LayoutItemNestedControlCollection>
                                            <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                                                <dx:ASPxLabel ID="lbl_UserIn" runat="server" Text="">
                                                </dx:ASPxLabel>
                                            </dx:LayoutItemNestedControlContainer>
                                        </LayoutItemNestedControlCollection>
                                    </dx:LayoutItem>
                                    <dx:LayoutItem Caption="Фамилия заявителя:">
                                        <LayoutItemNestedControlCollection>
                                            <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                                                <dx:ASPxLabel ID="lbl_RequesterName" runat="server" Text="">
                                                </dx:ASPxLabel>
                                            </dx:LayoutItemNestedControlContainer>
                                        </LayoutItemNestedControlCollection>
                                    </dx:LayoutItem>
                                    <dx:LayoutItem Caption="Дата создания:">
                                        <LayoutItemNestedControlCollection>
                                            <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                                                <dx:ASPxLabel ID="lbl_DateCreate" runat="server" Text="">
                                                </dx:ASPxLabel>
                                            </dx:LayoutItemNestedControlContainer>
                                        </LayoutItemNestedControlCollection>
                                    </dx:LayoutItem>
                                    <dx:LayoutItem Caption="Телефон заявителя:">
                                        <LayoutItemNestedControlCollection>
                                            <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                                                <dx:ASPxLabel ID="lbl_RequesterPhone" runat="server" Text="">
                                                </dx:ASPxLabel>
                                            </dx:LayoutItemNestedControlContainer>
                                        </LayoutItemNestedControlCollection>
                                    </dx:LayoutItem>
                                    <dx:LayoutItem Caption="Время поступления:">
                                        <LayoutItemNestedControlCollection>
                                            <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                                                <dx:ASPxLabel ID="lbl_DateIn" runat="server" Text="">
                                                </dx:ASPxLabel>
                                            </dx:LayoutItemNestedControlContainer>
                                        </LayoutItemNestedControlCollection>
                                    </dx:LayoutItem>
                                    <dx:LayoutItem Caption="Вид проблемы:">
                                        <LayoutItemNestedControlCollection>
                                            <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                                                <dx:ASPxLabel ID="lbl_JobType" runat="server" Text="">
                                                </dx:ASPxLabel>
                                            </dx:LayoutItemNestedControlContainer>
                                        </LayoutItemNestedControlCollection>
                                    </dx:LayoutItem>
                                    <dx:LayoutItem Caption="Срок:">
                                        <LayoutItemNestedControlCollection>
                                            <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                                                <dx:ASPxLabel ID="lbl_DueDate" runat="server" Text="">
                                                </dx:ASPxLabel>
                                            </dx:LayoutItemNestedControlContainer>
                                        </LayoutItemNestedControlCollection>
                                    </dx:LayoutItem>
                                    <dx:LayoutItem Caption="Локализация:">
                                        <LayoutItemNestedControlCollection>
                                            <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                                                <dx:ASPxLabel ID="lbl_Loc" runat="server" Text="">
                                                </dx:ASPxLabel>
                                            </dx:LayoutItemNestedControlContainer>
                                        </LayoutItemNestedControlCollection>
                                    </dx:LayoutItem>
                                    <dx:LayoutItem Caption="Выполнена:">
                                        <LayoutItemNestedControlCollection>
                                            <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                                                <dx:ASPxLabel ID="lbl_DateComplet" runat="server" Text="">
                                                </dx:ASPxLabel>
                                            </dx:LayoutItemNestedControlContainer>
                                        </LayoutItemNestedControlCollection>
                                    </dx:LayoutItem>
                                    <dx:LayoutItem Caption="Аварийная?">
                                        <LayoutItemNestedControlCollection>
                                            <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                                                <dx:ASPxLabel ID="lbl_IsEmergency" runat="server" Text="">
                                                </dx:ASPxLabel>
                                            </dx:LayoutItemNestedControlContainer>
                                        </LayoutItemNestedControlCollection>
                                    </dx:LayoutItem>
                                    <dx:LayoutItem Caption="Закрыта:">
                                        <LayoutItemNestedControlCollection>
                                            <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                                                <dx:ASPxLabel ID="lbl_isClosed" runat="server" Text="">
                                                </dx:ASPxLabel>
                                            </dx:LayoutItemNestedControlContainer>
                                        </LayoutItemNestedControlCollection>
                                    </dx:LayoutItem>
                                    <dx:LayoutItem Caption="Платная?">
                                        <LayoutItemNestedControlCollection>
                                            <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                                                <dx:ASPxLabel ID="lbl_IsPaid" runat="server" Text="">
                                                </dx:ASPxLabel>
                                            </dx:LayoutItemNestedControlContainer>
                                        </LayoutItemNestedControlCollection>
                                    </dx:LayoutItem>
                                    <dx:LayoutItem Caption="Организация:">
                                        <LayoutItemNestedControlCollection>
                                            <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                                                <dx:ASPxLabel ID="lbl_WorkCompany" runat="server" Text="">
                                                </dx:ASPxLabel>
                                            </dx:LayoutItemNestedControlContainer>
                                        </LayoutItemNestedControlCollection>
                                    </dx:LayoutItem>
                                    <dx:LayoutItem Caption="Исполнитель:">
                                        <LayoutItemNestedControlCollection>
                                            <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                                                <dx:ASPxLabel ID="lbl_ExecutorName" runat="server" Text="">
                                                </dx:ASPxLabel>
                                            </dx:LayoutItemNestedControlContainer>
                                        </LayoutItemNestedControlCollection>
                                    </dx:LayoutItem>
                                </Items>
                            </dx:LayoutGroup>
                        </Items>
                        <SettingsItemCaptions HorizontalAlign="Right" />
                    </dx:LayoutGroup>
                    <dx:LayoutGroup Caption="Данные о выполнении" Width="100%">
                        <Items>
                            <dx:LayoutGroup Caption="Layout Group" ShowCaption="False">
                                <Items>
                                    <dx:LayoutItem Caption="Layout Item" ShowCaption="False">
                                        <LayoutItemNestedControlCollection>
                                            <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                                                <dx:ASPxGridView ID="grd_detail" runat="server" AutoGenerateColumns="False" DataSourceID="ds_detail" Width="100%" KeyFieldName="id">
                                                    <Columns>
                                                        <dx:GridViewDataTextColumn FieldName="Id" ReadOnly="True" ShowInCustomizationForm="True" VisibleIndex="0">
                                                        </dx:GridViewDataTextColumn>
                                                        <dx:GridViewDataDateColumn Caption="Дата" FieldName="data" ReadOnly="True" ShowInCustomizationForm="True" VisibleIndex="1">
                                                            <PropertiesDateEdit DisplayFormatString="dd.MM.yyyy hh:mm" EditFormat="DateTime">
                                                            </PropertiesDateEdit>
                                                        </dx:GridViewDataDateColumn>
                                                        <dx:GridViewDataTextColumn FieldName="Status" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="2">
                                                        </dx:GridViewDataTextColumn>
                                                        <dx:GridViewDataTextColumn Caption="Вид" FieldName="StatusName" ReadOnly="True" ShowInCustomizationForm="True" VisibleIndex="3">
                                                        </dx:GridViewDataTextColumn>
                                                        <dx:GridViewDataTextColumn FieldName="USR" ReadOnly="True" ShowInCustomizationForm="True" Visible="False" VisibleIndex="4">
                                                        </dx:GridViewDataTextColumn>
                                                        <dx:GridViewDataTextColumn Caption="Добавил" FieldName="USERNAME" ReadOnly="True" ShowInCustomizationForm="True" VisibleIndex="5">
                                                        </dx:GridViewDataTextColumn>
                                                        <dx:GridViewDataTextColumn Caption="Комментарии" FieldName="NOTE" ReadOnly="True" ShowInCustomizationForm="True" VisibleIndex="6">
                                                        </dx:GridViewDataTextColumn>
                                                    </Columns>
                                                    <SettingsBehavior AllowSort="False"/>
                                                </dx:ASPxGridView>
                                                <asp:SqlDataSource ID="ds_detail" runat="server" ConnectionString="<%$ ConnectionStrings:DispatcherWebAppConnectionString %>" SelectCommand="SELECT rg.RequestId AS Id, CONVERT (datetime, SWITCHOFFSET(CONVERT (datetimeoffset, rg.CreatedAtUtc), DATENAME(TzOffset, SYSDATETIMEOFFSET()))) AS data, 1 AS Status, N'Не рассмотрена' AS StatusName, rg.CreatedBy AS USR, u.LastName + CHAR(32) + LEFT (u.FirstName, 1) + '. ' + LEFT (u.MiddleName, 1) + '.' AS USERNAME, rg.RequestBody AS NOTE FROM Rq_Request AS rg LEFT OUTER JOIN App_User AS u ON u.UserId = rg.CreatedBy WHERE (rg.RequestId = @ID) UNION ALL SELECT c.CommentId AS id, CONVERT (datetime, SWITCHOFFSET(CONVERT (datetimeoffset, c.CreatedAtUtc), DATENAME(TzOffset, SYSDATETIMEOFFSET()))) AS data, c.Status, CASE WHEN c.[Status] = 1 THEN N'Не рассмотрена' WHEN c.[Status] = 2 THEN N'В процессе' WHEN c.[Status] = 3 THEN N'Выполнена' WHEN c.[Status] = 4 THEN N'Возвращена' WHEN c.[Status] = 5 THEN N'Снята' WHEN c.[Status] = 6 THEN N'Закрыта' WHEN c.[Status] = 7 THEN N'Отложена' WHEN c.[Status] = 8 THEN N'Текущий ремонт' WHEN c.[Status] = 9 THEN N'Запрос в службу эксплуатации (СЭ)' ELSE '' END AS StatusName, c.CreatedBy AS USR, u.LastName + CHAR(32) + LEFT (u.FirstName, 1) + '. ' + LEFT (u.MiddleName, 1) + '.' AS USERNAME, c.CommentBody AS NOTE FROM Rq_Comment AS c LEFT OUTER JOIN App_User AS u ON u.UserId = c.CreatedBy WHERE (c.RequestId = @ID1) AND (c.IsDeleted = 0) AND (c.IsSystem = 0)">
                                                    <SelectParameters>
                                                        <asp:QueryStringParameter DefaultValue="-1" Name="ID" QueryStringField="code" />
                                                        <asp:QueryStringParameter DefaultValue="-1" Name="ID1" QueryStringField="code" />
                                                    </SelectParameters>
                                                </asp:SqlDataSource>
                                                <asp:SqlDataSource ID="ds_serviswork" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionStringDez %>" ProviderName="<%$ ConnectionStrings:ConnectionStringDez.ProviderName %>" SelectCommand="SELECT &quot;CODE&quot;, &quot;NAME&quot;, &quot;ED&quot;, &quot;PRICE&quot; FROM &quot;SERVISWORK&quot; ORDER BY &quot;NAME&quot;"></asp:SqlDataSource>
                                                <asp:SqlDataSource ID="SqlDataSource2" runat="server"></asp:SqlDataSource>
                                            </dx:LayoutItemNestedControlContainer>
                                        </LayoutItemNestedControlCollection>
                                    </dx:LayoutItem>
                                </Items>
                            </dx:LayoutGroup>
                            <dx:TabbedLayoutGroup Caption="Layout Group">
                                <Items>
                                    <dx:LayoutGroup Caption="Отетить как выполненую">
                                        <Items>
                                            <dx:LayoutItem Caption="Layout Item" ShowCaption="False">
                                                <LayoutItemNestedControlCollection>
                                                    <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                                                        <dx:ASPxLabel ID="lbl_period" runat="server" Text="Допустимый период" Font-Bold="True" ForeColor="Red">
                                                        </dx:ASPxLabel>
                                                    </dx:LayoutItemNestedControlContainer>
                                                </LayoutItemNestedControlCollection>
                                            </dx:LayoutItem>
                                            <dx:LayoutGroup Caption="Layout Group" ColCount="2" ShowCaption="False">
                                                <Items>
                                                    <dx:LayoutItem Caption="Время выполнения">
                                                        <LayoutItemNestedControlCollection>
                                                            <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                                                                <dx:ASPxDateEdit ID="dt1" runat="server" Width="100px" EditFormat="Custom" EditFormatString="dd.MM.yyyy">
                                                                    <ValidationSettings>
                                                                        <RequiredField IsRequired="True" />
                                                                    </ValidationSettings>
                                                                </dx:ASPxDateEdit>
                                                            </dx:LayoutItemNestedControlContainer>
                                                        </LayoutItemNestedControlCollection>
                                                    </dx:LayoutItem>
                                                    <dx:LayoutItem Caption="Layout Item" ShowCaption="False">
                                                        <LayoutItemNestedControlCollection>
                                                            <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                                                                <dx:ASPxTimeEdit ID="tm1" runat="server" Width="80px">
                                                                </dx:ASPxTimeEdit>
                                                            </dx:LayoutItemNestedControlContainer>
                                                        </LayoutItemNestedControlCollection>
                                                    </dx:LayoutItem>
                                                </Items>
                                            </dx:LayoutGroup>
                                            <dx:LayoutItem Caption="Выезд АВС:" HorizontalAlign="Left" Width="60px">
                                                <LayoutItemNestedControlCollection>
                                                    <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True" Width="20px">
                                                        <dx:ASPxCheckBox ID="chk_ABC" runat="server" CheckState="Unchecked" CheckBoxStyle-HorizontalAlign="Left">
<CheckBoxStyle HorizontalAlign="Left"></CheckBoxStyle>
                                                        </dx:ASPxCheckBox>
                                                    </dx:LayoutItemNestedControlContainer>
                                                </LayoutItemNestedControlCollection>
                                                <CaptionSettings HorizontalAlign="Left" />
                                            </dx:LayoutItem>
                                            <dx:LayoutGroup Caption="Работа">
                                                <Items>
                                                    <dx:LayoutItem Caption="Layout Item" ShowCaption="False">
                                                        <LayoutItemNestedControlCollection>
                                                            <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                                                                <dx:ASPxComboBox ID="cbb_work" runat="server" Width="400px"
                                                                     EnableCallbackMode="true" CallbackPageSize="10" FilterMinLength="3" AutoResizeWithContainer="true" 
                                                                    IncrementalFilteringMode="Contains" ValueType="System.Int32" ValueField="CODE" DropDownStyle="DropDown"
                                                                     LoadingPanelDelay="200">
                                                                    <ValidationSettings>
                                                                        <RequiredField IsRequired="True" />
                                                                    </ValidationSettings>
                                                                </dx:ASPxComboBox>
                                                            </dx:LayoutItemNestedControlContainer>
                                                        </LayoutItemNestedControlCollection>
                                                    </dx:LayoutItem>
                                                    <dx:LayoutItem Caption="Добавить название работы в коментарий" Width="100px">
                                                        <LayoutItemNestedControlCollection>
                                                            <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                                                                <dx:ASPxCheckBox ID="chk_AddWork" runat="server" CheckState="Unchecked" Width="30px">
                                                                </dx:ASPxCheckBox>
                                                            </dx:LayoutItemNestedControlContainer>
                                                        </LayoutItemNestedControlCollection>
                                                        
                                                    </dx:LayoutItem>
                                                    <dx:LayoutGroup Caption="Layout Group" ColCount="3" ShowCaption="False">
                                                        <Items>
                                                            <dx:LayoutItem Caption="Ед. изм.">
                                                                <LayoutItemNestedControlCollection>
                                                                    <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                                                                        <dx:ASPxTextBox ID="txt_wed" runat="server" Width="70px">
                                                                        </dx:ASPxTextBox>
                                                                    </dx:LayoutItemNestedControlContainer>
                                                                </LayoutItemNestedControlCollection>
                                                            </dx:LayoutItem>
                                                            <dx:LayoutItem Caption="Объем">
                                                                <LayoutItemNestedControlCollection>
                                                                    <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                                                                        <dx:ASPxSpinEdit ID="spn_col" runat="server" Height="21px" Width="70px" Number="0">
                                                                        </dx:ASPxSpinEdit>
                                                                    </dx:LayoutItemNestedControlContainer>
                                                                </LayoutItemNestedControlCollection>
                                                            </dx:LayoutItem>
                                                            <dx:LayoutItem Caption="Цена">
                                                                <LayoutItemNestedControlCollection>
                                                                    <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                                                                        <dx:ASPxSpinEdit ID="spn_price" runat="server" Width="70px">
                                                                            <SpinButtons ShowIncrementButtons="False">
                                                                            </SpinButtons>
                                                                        </dx:ASPxSpinEdit>
                                                                    </dx:LayoutItemNestedControlContainer>
                                                                </LayoutItemNestedControlCollection>
                                                            </dx:LayoutItem>
                                                        </Items>
                                                        <SettingsItemCaptions HorizontalAlign="Right" />
                                                    </dx:LayoutGroup>
                                                    <dx:LayoutItem Caption="Коменарий" Width="100%">
                                                        <LayoutItemNestedControlCollection>
                                                            <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                                                                <dx:ASPxMemo ID="mmo_Note" runat="server" Height="50px" Width="100%">
                                                                </dx:ASPxMemo>
                                                            </dx:LayoutItemNestedControlContainer>
                                                        </LayoutItemNestedControlCollection>
                                                        <CaptionSettings Location="Top" />
                                                    </dx:LayoutItem>
                                                </Items>
                                            </dx:LayoutGroup>
                                            <dx:LayoutItem Caption="Layout Item" ShowCaption="False">
                                                <LayoutItemNestedControlCollection>
                                                    <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                                                        <dx:ASPxButton ID="btn_Exec" runat="server" Text="Выполнено" AutoPostBack="True" OnClick="btn_Exec_Click">
                                                        </dx:ASPxButton>
                                                    </dx:LayoutItemNestedControlContainer>
                                                </LayoutItemNestedControlCollection>
                                            </dx:LayoutItem>
                                        </Items>
                                        <SettingsItems HorizontalAlign="Left" />
                                    </dx:LayoutGroup>
                                    <dx:LayoutGroup Caption="Материалы">
                                        <Items>
                                            <dx:LayoutItem Caption="Layout Item" ShowCaption="False">
                                                <LayoutItemNestedControlCollection>
                                                    <dx:LayoutItemNestedControlContainer runat="server" SupportsDisabledAttribute="True">
                                                        <dx:ASPxGridView ID="grd_Mat" runat="server" Width="100%" AutoGenerateColumns="False" OnRowInserting="grd_Mat_RowInserting" KeyFieldName="ID" OnRowDeleting="grd_Mat_RowDeleting">
                                                            <Columns>
                                                                <dx:GridViewCommandColumn ShowInCustomizationForm="True" VisibleIndex="0">
                                                                    <NewButton Visible="True">
                                                                    </NewButton>
                                                                    <DeleteButton Visible="True">
                                                                    </DeleteButton>
                                                                </dx:GridViewCommandColumn>
                                                                <dx:GridViewDataComboBoxColumn Caption="Материал" FieldName="Code" ShowInCustomizationForm="True" VisibleIndex="2">
                                                                    <PropertiesComboBox DataSourceID="ds_mat" 
                                                                        EnableCallbackMode="true" CallbackPageSize="10" 
                                                                        IncrementalFilteringMode="Contains" FilterMinLength="3" 
                                                                        TextField="NAME" ValueField="CODE" ValueType="System.Int32" Width="220px">
                                                                    </PropertiesComboBox>
                                                                    <Settings FilterMode="DisplayText" />
                                                                </dx:GridViewDataComboBoxColumn>
                                                                <dx:GridViewDataSpinEditColumn Caption="Кол-во" FieldName="Quantity" ShowInCustomizationForm="True" VisibleIndex="3">
                                                                    <PropertiesSpinEdit DisplayFormatString="g">
                                                                    </PropertiesSpinEdit>
                                                                </dx:GridViewDataSpinEditColumn>
                                                                <dx:GridViewDataTextColumn FieldName="Ed" ShowInCustomizationForm="True" VisibleIndex="4">
                                                                </dx:GridViewDataTextColumn>
                                                                <dx:GridViewDataSpinEditColumn FieldName="Price" ShowInCustomizationForm="True" VisibleIndex="5">
                                                                    <PropertiesSpinEdit DisplayFormatString="g">
                                                                    </PropertiesSpinEdit>
                                                                </dx:GridViewDataSpinEditColumn>
                                                                <dx:GridViewDataTextColumn FieldName="ID" ShowInCustomizationForm="True" VisibleIndex="1">
                                                                    <EditFormSettings Visible="False" />
                                                                </dx:GridViewDataTextColumn>
                                                            </Columns>
                                                            <SettingsEditing EditFormColumnCount="1" />
                                                        </dx:ASPxGridView>
                                                        <asp:SqlDataSource ID="ds_mat" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionStringDez %>" EnableCaching="True" ProviderName="<%$ ConnectionStrings:ConnectionStringDez.ProviderName %>" SelectCommand="SELECT CODE,
       TRIM(FULLNAME) NAME,
       ED, 
       PRICE
FROM CLASSMAT
where ISGROUP=0
order by TRIM(FULLNAME)"></asp:SqlDataSource>
                                                        <asp:EntityDataSource ID="ds_WORKSPECLIST" runat="server" ConnectionString="name=Entities" DefaultContainerName="Entities" EnableFlattening="False" EnableInsert="True" EnableUpdate="True" EntitySetName="WORKSPECLIST">
                                                        </asp:EntityDataSource>
                                                    </dx:LayoutItemNestedControlContainer>
                                                </LayoutItemNestedControlCollection>
                                            </dx:LayoutItem>
                                        </Items>
                                    </dx:LayoutGroup>
                                </Items>
                            </dx:TabbedLayoutGroup>
                        </Items>
                    </dx:LayoutGroup>
                </Items>
            </dx:TabbedLayoutGroup>
        </Items>
    </dx:ASPxFormLayout>
</asp:Content>

